package subsystems

type ResourceConfig struct {
	MemoryLimit string
	CpuShare    string
	CpuSet      string
}

func MakeResourceConfig(m string, cpuset string, cpushare string) *ResourceConfig {
	this := &ResourceConfig{
		MemoryLimit: m,
		CpuShare:    cpushare,
		CpuSet:      cpuset,
	}
	return this
}

type SubSystemItf interface {
	Name() string
	Set(path string, resConfigPtr *ResourceConfig) error
	Apply(path string, pid int) error
	Remove(path string) error
}

var (
	SubSystemInstSlc = []SubSystemItf{
		MakeCpuSetSubSystem(),
		MakeMemorySubSystem(),
		MakeCpuSubSystem(),
	}
)
